from google.appengine.ext import db
from google.appengine.ext import search

##################################################################################
#                                                                                #
#                       Models                                                   #
#                                                                                #
##################################################################################

class Blog(db.Model):
  blogId = db.IntegerProperty()
  name = db.StringProperty()
  slug = db.StringProperty()
  url = db.StringProperty()
  description = db.TextProperty()
  firstMonth = db.StringProperty()
  firstYear = db.StringProperty()
  firstPost = db.DateTimeProperty()
  country = db.StringProperty()
  author = db.StringProperty()
  email = db.StringProperty()
  pubDate = db.DateTimeProperty(auto_now_add=True)
  twitter = db.StringProperty()
  percentage = db.IntegerProperty()

class Libro(db.Model):
  libroId = db.IntegerProperty()
  name = db.StringProperty()
  slug = db.StringProperty()
  description = db.TextProperty()
  country = db.StringProperty()
  author = db.StringProperty()
  pubDate = db.DateTimeProperty(auto_now_add=True)
  language = db.StringProperty()

class Revista(db.Model):
  revistaId = db.IntegerProperty()
  name = db.StringProperty()
  slug = db.StringProperty()
  description = db.TextProperty()
  country = db.StringProperty()
  pubDate = db.DateTimeProperty(auto_now_add=True)
  language = db.StringProperty()

class Tutorial(db.Model):
  tutorialId = db.IntegerProperty()
  title = db.StringProperty()
  slug = db.StringProperty()
  text = db.TextProperty()
  pubDate = db.DateTimeProperty(auto_now_add=True)
  author = db.StringProperty()

class Video(db.Model):
  videoId = db.IntegerProperty()
  title = db.StringProperty()
  slug = db.StringProperty()
  description = db.TextProperty()
  videoDate = db.DateTimeProperty()
  pubDate = db.DateTimeProperty(auto_now_add=True)
  author = db.StringProperty()
  url = db.StringProperty()
  code = db.StringProperty()
  
class Tienda(db.Model):
  tiendaId = db.IntegerProperty()
  name = db.StringProperty()
  slug = db.StringProperty()
  description = db.TextProperty()
  pubDate = db.DateTimeProperty(auto_now_add=True)
  owner = db.StringProperty()
  url = db.StringProperty()
  email = db.StringProperty()
  address = db.StringProperty()
  location = db.StringProperty()
  country = db.StringProperty()

class Cosa(db.Model):
  cosaId = db.IntegerProperty()
  title = db.StringProperty()
  slug = db.StringProperty()
  url = db.StringProperty()
  urlimg = db.StringProperty()
  bytes_content = db.BlobProperty()
  width = db.IntegerProperty()
  height = db.IntegerProperty()
  description = db.TextProperty()
  pubDate = db.DateTimeProperty(auto_now_add=True)
  tags = db.StringListProperty()
  featured = db.BooleanProperty(default=False)
  tag = db.StringProperty()
  tagSlug = db.StringProperty()
  categoria = db.StringProperty()
  categoriaSlug = db.StringProperty()

class Comentario(db.Model):
  comentarioId = db.IntegerProperty()
  objeto = db.StringProperty()
  objetoId = db.StringProperty()
  url = db.StringProperty()
  email = db.StringProperty()
  name = db.StringProperty()
  text = db.TextProperty()
  pubDate = db.DateTimeProperty(auto_now_add=True)

class Categoria(db.Model):
  categoriaId = db.IntegerProperty()
  singular = db.StringProperty()
  singularSlug = db.StringProperty()
  plural = db.StringProperty()
  pluralSlug = db.StringProperty()
  menu = db.StringProperty()

class Tag(db.Model):
  tagId = db.IntegerProperty()
  singular = db.StringProperty()
  singularSlug = db.StringProperty()
  plural = db.StringProperty()
  pluralSlug = db.StringProperty()
  father = db.StringProperty()
  fatherSlug = db.StringProperty()

class Comentario(db.Model):
  comentarioId = db.IntegerProperty()
  objectType = db.IntegerProperty()
  objectId = db.IntegerProperty()
  slug = db.StringProperty()
  author = db.StringProperty()
  email = db.StringProperty()
  url = db.StringProperty()
  text = db.TextProperty()
  pubDate = db.DateTimeProperty(auto_now_add=True)
  ip = db.StringProperty()

class CustomUser(db.Model):
  name = db.StringProperty()
  user = db.UserProperty()
  role = db.StringProperty()